var box = document.getElementById('box');

box.insertAdjacentHTML('beforebegin','<input name="username" />');